Element Exists
AutomatR.Web.ElementExists
The "Element Exists" activity in AutomatR's Web Activities category allows you to verify if a UI element exists, even if it is not visible. This is a crucial step in web automation workflows to ensure that the desired element is present on the webpage.
Properties
Name | Description |
---|---|
Input | |
WebElement | Enter a UI Element variable identified by the "Find Element" or other activity. This is an alternative to providing the element directly using the "Web Selector." |
Web Selector | Select the browse button to indicate the element on the web with the help of the selector window. Use this if you haven't provided a WebElement. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Timeout | Enter the wait time in seconds (Example: 5 seconds, i.e., 5) to wait for the activity to start. Default is set to a common timeout value if not provided. |
Delay | Enter the wait time in seconds (Example: 5 seconds, i.e., 5) before executing the "Element Exists" activity. Useful for handling synchronization issues. |
Output | |
Result | Outputs True or False based on whether the specified UI element exists or not. Variables of Boolean type to store the operation result. |
How to use:
- Drag and drop the "Element Exists" activity onto the workflow.
- Configure either the "WebElement" (using a UI Element variable) or the "Web Selector" to identify the target element on the web.
- Optionally, configure the "Timeout" to specify the maximum time to wait for the activity to start (default is set to a common timeout value).
- Optionally, configure the "Delay" to introduce a wait time before executing the "Element Exists" activity.
- Execute the workflow to verify if the specified UI element exists on the webpage.
Example: Consider an example where the "Element Exists" activity is used to check whether a button with a specific selector exists on a webpage:
Element Exists:
Web Selector: (Selector indicating the button)
Timeout: 10
Delay: 2
Result: doesElementExist
In this example, the activity checks if the UI element specified by the web selector exists on the webpage within a timeout of 10 seconds. The result (True or False) is stored in the boolean variable "doesElementExist" for further handling in the workflow.